package org.example.object;

/**
 * cd base
 * javac src/main/java/org/example/object/BoxingUnboxingDemo.java
 * javap -c src/main/java/org/example/object/BoxingUnboxingDemo
 */
public class BoxingUnboxingDemo {
    /**
     *  public static void main(java.lang.String[]);
     *     Code:
     *        0: bipush        10
     *        2: invokestatic  #7                  // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     *        5: astore_1
     *        6: aload_1
     *        7: invokevirtual #13                 // Method java/lang/Integer.intValue:()I
     *       10: istore_2
     *       11: return
     */
    public static void main(String[] args) {
        Integer boxed = 10;  // 装箱 Integer.valueOf
        int unboxed = boxed;  // 拆箱 Integer.intValue
    }
}